<template>
	<view>
		<view class="boxContrainer">
			<view class="contentBox">
				<template v-if="detailInfo.secondedType == 1">
					<view class="textItem">
						<text>订单号</text>
						<text style="color: #333;">{{detailInfo.orderNo | filterNull}}</text>
					</view>
					<view class="textItem">
						<text>车型信息</text>
						<text style="color: #333;">{{detailInfo.modelName|filterNull}}</text>
					</view>
					<view class="textItem">
						<text style="width: 200rpx;">租赁时间</text>
						<text style="color: #333;">{{detailInfo.rentalStartTime}}至{{detailInfo.rentalEndTime}}</text>
					</view>
				</template>

				<view class="textItem">
					<text>借调同行</text>
					<text style="color: #333;">{{detailInfo.sameJobName|filterNull}}</text>
				</view>
				<view class="textItem" >
					<text>车牌号</text>
					<text style="color: #333;">{{detailInfo.carNo|filterNull}}</text>
				</view>
				<view class="textItem" v-if="detailInfo.secondedType==1">
					<text>车架号</text>
					<text style="color: #333;">{{detailInfo.vinNo|filterNull}}</text>
				</view>
				<view class="textItem">
					<text>借调开始日期</text>
					<text style="color: #333;">{{detailInfo.startTime| filterNull}}</text>
				</view>
				<view class="textItem">
					<text>预约借调结束日期</text>
					<text style="color: #333;">{{detailInfo.estimateEndTime| filterNull}}</text>
				</view>
				<view class="textItem">
					<text>预约借调天数</text>
					<text style="color: #333;">{{detailInfo.estimateDay|filterNull}}天</text>
				</view>
				<template v-if="detailInfo.secondedStatus ==2">
					<view class="textItem">
						<text>实际结束日期</text>
						<text style="color: #333;">{{detailInfo.actualEndTime|filterNull}}</text>
					</view>
					<view class="textItem">
						<text>实际借调天数</text>
						<text style="color: #333;">{{detailInfo.actualDay|filterNull}}天</text>
					</view>
				</template>
				
				<view class="textItem" v-if="detailInfo.secondedType == 1">
					<text>借调单价</text>
					<text v-if="detailInfo.secondedUnitPrice"  style="color: #333;">{{detailInfo.secondedUnitPrice|}}元/天</text>
					<text v-else  style="color: #333;">--</text>
				</view>
				
				<view class="textItem" v-if="detailInfo.secondedStatus ==2">
					<text>借调费用</text>
					<text v-if="detailInfo.totalRent" style="color: #333;">{{detailInfo.totalRent}}元</text>
					<text v-else style="color: #333;">--</text>
				</view>
				
				<view class="textItem" v-if="detailInfo.carSource==6 && detailInfo.secondedType==2">
					<text>托管费用</text>
					<text  v-if="detailInfo.hostingFees" style="color: #333;">{{detailInfo.hostingFees}}元</text>
					<text v-else style="color: #333;">--</text>
				</view>
				
				<view class="textItem">
					<text>结算方式</text>
					<text style="color: #333;">{{detailInfo.settlementWay|settlementWay}}</text>
				</view>
				<view class="textItem">
					<text>借调备注</text>
					<text style="color: #333;">{{detailInfo.remark|filterNull}}</text>
				</view>
				<view class="textItem" style="flex-direction: column;align-items: flex-start;">
					<text style="margin-bottom: 16rpx;">车辆初始化图片</text>
					<u-album :urls="url1" singleSize="100" multipleSize="100">
					</u-album>
				</view>
				<block v-if="detailInfo.secondedStatus ==2">
					<view class="textItem">
						<text>结束借调备注</text>
						<text style="color: #333;">{{detailInfo.endRemark|filterNull}}</text>
					</view>
					<view class="textItem" style="flex-direction: column;align-items: flex-start;">
						<text style="margin-bottom: 16rpx;">借调结束图片</text>
						<u-album :urls="url2" singleSize="100" multipleSize="100">
						</u-album>
					</view>
				</block>
				
			</view>
		</view>

	</view>
</template>

<script>
	import * as secondedApi from '@/api/seconded-api.js';
	import settings from '@/settings.js'
	export default {
		data() {
			return {
				url1: [],
				url2:[],
				detailInfo: {},
				id : ''
			}
		},
		onLoad(op) {
            this.id = op.id;
			this.getSecondedDetail();
		},
		methods: {
            getSecondedDetail() {
            	secondedApi.secondedDetail(this.id).then(res => {
            		this.detailInfo = res.data;
            		if(!uni.$u.test.isEmpty(this.detailInfo.initialPicture)) {
            			this.url1 = this.detailInfo.initialPicture.map(url=>{
							return settings.baseImageUrl + url
						})
            		}
					if(!uni.$u.test.isEmpty(this.detailInfo.endPicture)) {
						this.url2 = this.detailInfo.endPicture.map(url=>{
							return settings.baseImageUrl + url
						})
					}
            	});
            },
		}
	}
</script>

<style lang="scss" scoped>

</style>
